<template>
    <div :style="{'direction': $vs.rtl ? 'rtl' : 'ltr'}">
        <feather-icon icon="Edit3Icon" svgClasses="h-5 w-5 mr-4 hover:text-primary cursor-pointer" @click="toEdit(params.data)" />
        <feather-icon icon="Trash2Icon" svgClasses="h-5 w-5 hover:text-danger cursor-pointer" @click="Delete(params)" />
    </div>
</template>

<script>
export default {
  name: 'CellRendererActions',
  methods: {
    toEdit(row){
    
      // console.log(this.$parent.$parent);
      this.$parent.$parent.editerData = row;
      console.log(this.$parent.$parent);
      this.$parent.$parent.sidebarActive = true;
    },
    editRecord () {
      this.$router.push(`/apps/user/user-edit/${  268}`).catch(() => {})
    },
    confirmDeleteRecord () {
      this.$vs.dialog({
        type: 'confirm',
        color: 'danger',
        title: 'Confirm Delete',
        text: `You are about to delete "${this.params.data.username}"`,
        accept: this.deleteRecord,
        acceptText: 'Delete'
      })
    },
    
    deleteRecord () {
      this.showDeleteSuccess()
    },
    showDeleteSuccess () {
      this.$vs.notify({
        color: 'success',
        title: 'User Deleted',
        text: 'The selected user was successfully deleted'
      })
    }
  }
}
</script>
